package com.geek.water.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.geek.water.entity.WorkOrder;

import java.util.List;

/**
 * 工单服务接口
 */
public interface WorkOrderService {

    /**
     * 创建工单
     */
    boolean createWorkOrder(WorkOrder workOrder);

    /**
     * 分页查询工单
     */
    Page<WorkOrder> findPage(Integer currentPage, Integer pageSize, String type, String status, Long deviceId, Long siteId, Long creatorId, Long assigneeId);

    /**
     * 根据ID查询工单
     */
    WorkOrder getById(Long id);



    /**
     * 派发工单
     */
    boolean assignWorkOrder(Long workOrderId, Long assigneeId);

    /**
     * 更新工单状态
     */
    boolean updateWorkOrderStatus(Long workOrderId, String status);

    /**
     * 完成工单
     */
    boolean completeWorkOrder(Long workOrderId, String description);

    /**
     * 评价工单
     */
    boolean evaluateWorkOrder(Long workOrderId, String evaluation);

    /**
     * 根据设备ID查询工单
     */
    List<WorkOrder> findByDeviceId(Long deviceId);

    /**
     * 根据站点ID查询工单
     */
    List<WorkOrder> findBySiteId(Long siteId);
}


